import request from '@/utils/request'
// 店铺列表
export function getShopList(page, condition) {
  return request({
    url: '/api/back/offline/shop',
    method: 'get',
    params: { type: 'lists', page, condition, per_page: 10 }
  })
}
// 店员列表
export function getAssistantList({ page, condition, id } = {}) {
  return request({
    url: '/api/back/offline/shop',
    method: 'get',
    params: { type: 'employee', page, condition, id }
  })
}
// 获取店铺申请列表
export function getShopApplyList({ page, condition, id, audit }) {
  return request({
    url: '/api/back/offline/shop',
    method: 'get',
    params: { type: 'apply', page, condition, id, audit, per_page: 7 }
  })
}
// 处理店铺申请
export function dealWithShopApply({ status, remark, id }) {
  return request({
    url: '/api/back/offline/shop',
    method: 'post',
    params: { type: 'operation' },
    data: { status, remark, id }
  })
}
// 获取收益详情
export function getEarningDetail({ condition, page, start_time, end_time, id, status }) {
  return request({
    url: '/api/back/offline/shop',
    method: 'get',
    params: { type: 'clerksales', per_page: 7, condition, page, start_time, end_time, id, status }
  })
}
// 获取店铺下现有商品
export function getShopExistGoods({ id, page, condition }) {
  return request({
    url: '/api/back/offline/clerk',
    method: 'get',
    params: { type: 'commodity', id, page, condition }
  })
}
// 删除
export function deleteShopItem(id) {
  return request({
    url: '/api/back/offline/shop',
    method: 'post',
    params: { type: 'delete' },
    data: { id }
  })
}
